package cn.HuanG.order.controller;

import cn.HuanG.order.service.IOrderProductService;
import cn.HuanG.util.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

@RestController
@RequestMapping("/orderproduct")
public class OrderProductController {

    @Autowired
    private IOrderProductService orderProductService;

    @PostMapping("/orderSubmit")
    public AjaxResult orderSubmit(@RequestBody Map<String, String> map, HttpServletRequest request){
        System.out.println("服务map里面有什么："+map);
        String result = orderProductService.createOrderProduct(map, request);
        return  AjaxResult.me().setResultObj(result);
    }

}
